home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Communications Toolbox / CommToolbox 1.1 / Interfaces / CIncludes / CommResources.h next >
Encoding:
C/C++ Source or Header  |  1994-11-21  |  3.0 KB  |  101 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  CommResources.h
  3.  C Interface to the Macintosh Libraries
  4.  
  5.   Copyright Apple Computer, Inc. 1988-1991
  6.   All rights reserved
  7. ************************************************************/
  8.  
  9.  
  10. #ifndef __COMMRESOURCES__
  11. #define __COMMRESOURCES__
  12.  
  13. #ifndef __OSUTILS__
  14. #include <OSUtils.h>
  15. #endif
  16.  
  17.  
  18. enum {
  19.  
  20.  
  21. /*    version of the Comm Resource Manager    */
  22.     curCRMVersion = 2,
  23.  
  24. /*    tool classes (also the tool file types)    */
  25.  
  26. #define                classCM                'cbnd'
  27. #define                classFT                'fbnd'
  28. #define                classTM                'tbnd'
  29.  
  30. /* constants general to the use of the Communications Resource Manager */
  31.  
  32.     crmType = 9,            /* queue type    */
  33.     crmRecVersion = 1,        /* version of queue structure */
  34.  
  35. /*    error codes */
  36.     crmGenericError = -1,
  37.     crmNoErr = 0
  38. };
  39.  
  40. /* data structures general to the use of the Communications Resource Manager */
  41. typedef                OSErr    CRMErr;
  42.  
  43. struct CRMRec {
  44.  QElemPtr qLink;        /*reserved*/
  45.  short qType;            /*queue type -- ORD(crmType) = 9*/
  46.  short crmVersion;        /*version of queue element data structure*/
  47.  long crmPrivate;        /*reserved*/
  48.  short crmReserved;        /*reserved*/
  49.  long crmDeviceType;    /*type of device, assigned by DTS*/
  50.  long crmDeviceID;        /*device ID; assigned when CRMInstall is called*/
  51.  long crmAttributes;    /*pointer to attribute block*/
  52.  long crmStatus;        /*status variable - device specific*/
  53.  long crmRefCon;        /*for device private use*/
  54. };
  55.  
  56. typedef struct CRMRec CRMRec;
  57. typedef CRMRec *CRMRecPtr;
  58.  
  59.  
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63. pascal CRMErr     InitCRM(void);
  64. pascal QHdrPtr     CRMGetHeader(void);
  65. pascal void     CRMInstall(QElemPtr crmReqPtr);
  66. pascal OSErr     CRMRemove(QElemPtr crmReqPtr);
  67. pascal QElemPtr CRMSearch(QElemPtr crmReqPtr);
  68. pascal short     CRMGetCRMVersion(void);
  69.  
  70. pascal Handle     CRMGetResource(ResType theType,short theID);
  71. pascal Handle     CRMGet1Resource(ResType theType,short theID);
  72. pascal Handle     CRMGetIndResource(ResType theType,short index);
  73. pascal Handle     CRMGet1IndResource(ResType theType,short index);
  74. pascal Handle     CRMGetNamedResource(ResType theType,ConstStr255Param name);
  75. pascal Handle     CRMGet1NamedResource(ResType theType,ConstStr255Param name);
  76. pascal void     CRMReleaseResource(Handle theHandle);
  77. pascal Handle     CRMGetToolResource(short procID,ResType theType,short theID);
  78. pascal Handle     CRMGetToolNamedResource(short procID,ResType theType,ConstStr255Param name);
  79. pascal void       CRMReleaseToolResource(short procID,Handle theHandle);
  80. pascal long     CRMGetIndex(Handle theHandle);
  81.  
  82. pascal short     CRMLocalToRealID(ResType bundleType,short toolID,ResType theType,
  83.  short localID);
  84. pascal short     CRMRealToLocalID(ResType bundleType,short toolID,ResType theType,
  85.  short realID);
  86.  
  87. pascal OSErr    CRMGetIndToolName(OSType bundleType,short index,Str255 toolName);
  88.  
  89. pascal OSErr     CRMFindCommunications(short *vRefNum,long *dirID);
  90.  
  91. pascal Boolean    CRMIsDriverOpen(ConstStr255Param driverName);
  92.  
  93. pascal CRMErr    CRMParseCAPSResource(Handle theHandle,ResType selector,unsigned long *value);
  94.  
  95. pascal OSErr    CRMReserveRF(short refNum);
  96. pascal OSErr    CRMReleaseRF(short refNum);
  97. #ifdef __cplusplus
  98. }
  99. #endif
  100.  
  101. #endif